package com.itheima.demo;

public class MyFactorialDemo {
    public static void main(String[] args) {
        int result = getjc(5);
        System.out.println(result);
    }

    private static int getjc(int i) {
        if (i == 1) {
            return 1;
        }else {
            return i * getjc(i-1);
        }
    }
}
